package day10_io_code.com.itheima.d4_printstream;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;

public class PrintStreamDemo2 {
    public static void main(String[] args) throws FileNotFoundException {
        System.out.println("hello,world");
        System.out.println("红豆生南国");
        System.out.println("西风瘦马");

        PrintStream ps = new PrintStream(new FileOutputStream("d:/b.txt"));
        System.setOut(ps);
        System.out.println("hello,world");
    }
}
